package demo;

/*普通类*/
public class Animal {
    private Rabbit rabbit1;
    private Rabbit rabbit2;

    public Rabbit getRabbit1() {
        return rabbit1;
    }

    public void setRabbit1(Rabbit rabbit1) {
        this.rabbit1 = rabbit1;
    }

    public Rabbit getRabbit2() {
        return rabbit2;
    }

    public void setRabbit2(Rabbit rabbit2) {
        this.rabbit2 = rabbit2;
    }

    @Override
    public String toString() {
        return "Animal{" +
                "rabbit1=" + rabbit1.getName() +
                ", rabbit2=" + rabbit2.getName() +
                '}';
    }
}